package com.example.state;

import android.content.Context;
import android.util.Log;
import android.view.KeyEvent;

import com.example.bounce.Bounce;
import com.example.glsurfaceview.MyGLSurfaceView;

/**
 * Created by Lucas on 06/06/13.
 */
public class Achievement extends AppState {

    /**
     * The application
     */
    private Bounce _bounce;
    /**
     * The debug TAG
     */
    private final String TAG = "AchievementState";

    /**
     * The constructor
     * @param context the context of the application
     * @param glView the GLSurfaceView of the aplication
     */
    public Achievement(Context context, MyGLSurfaceView glView) {
        super(context, glView);
        _bounce = (Bounce)context;
    }

    /**
     * initialize the list of game shape
     */
    @Override
    public void initGameShape(){
        Log.i(TAG, "Initialize game's shapes");
    }

    /**
     * Set the button back event
     * @param keyCode
     * @param event
     * @return
     */
    @Override
    public boolean onKeyDown(int keyCode, KeyEvent event) {
        if (keyCode == KeyEvent.KEYCODE_BACK )
        {
            _bounce.changeState(HOME);
            return true;
        }
        return false;
    }
}
